


<!-- MAIN CONTENT -->
<div id="content">
    <div smart-include="app/yksensor/views/sub-header.tpl.html"></div>

    <div class="clearfix margin-bottom-10">
        <div class="pull-left margin-left-25">

            <strong class="font-md">设备编号：</strong>
            <label class="input">
                
                <input type="text" class="ipt_form" style="vertical-align: middle" ng-model="paginationConf.deviceid">
            </label>
           
        </div>
        <div class="pull-left margin-left-25">

            <strong class="font-md">是否处理：</strong>
            <label class="input">
                
                <select name="" id="" class="ipt_form" ng-model="paginationConf.handle_status" style="height:26px;">
                    <option value="1">是</option>
                    <option value="0">否</option>
                </select>
            </label>

        </div>
        <div class="pull-left margin-left-25">

            <strong class="font-md">时间范围：</strong>
            <label class="input">
                <input type="text" name="startdate" id="startdate" placeholder="开始日期：">
                <i class="icon-append fa fa-calendar"></i>
            </label>
            -
            <label class="input">
                <input type="text" name="finishdate" id="finishdate" placeholder="结束日期：">
                <i class="icon-append fa fa-calendar"></i>
            </label>
            <a class="btn btn-primary" href-void="" ng-click="sends()">查询</a>

        </div>
    </div>
    <div class="table-responsive">
        <table class="table table-bordered table-hover no-margin font-sml table-striped sensor_table">
            <thead>
                <tr>
                    <th ng-show="alarm">操作</th>
                    <th class="text-align-center">报警信息ID</th>
                    <th class="text-align-center">报警类型</th>
                    <th class="text-align-center">报警字段</th>
                    <th class="text-align-center">设备编号</th>
                    <th class="text-align-center">终端时间</th>
                    <th class="text-align-center">处理方式</th>
                    <th class="text-align-center">处理备注</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="data in datas">
                    <td ng-show="alarm">
                        <button class='btn btn-xs btn-default' uib-tooltip='编辑' tooltip-append-to-body='true' ng-click="showEditAlert(data)"><i class='fa fa-pencil'></i>处理</button>
                        
                    </td>
                    <td class="text-align-center">{{data.id}}</td>
                    <td class="text-align-center">{{data.warn_type == 1 ? '上限报警' :(data.warn_type == 2 ? '下限报警' : (data.warn_type == 3 ? '其他报警' : (data.warn_type == 4 ? '等级报警' : '' )))
                    }}</td>
                    <td class="text-align-center">{{data.fieldname == "flow" ? "流量" : (data.fieldname == "pos" ? "液位" : (data.fieldname == "temp" ? "温度" : data.fieldname)) }}</td>
                    <td class="text-align-center">{{data.deviceid}}</td>
                    <td class="text-align-center">{{data.time | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <td class="text-align-center">{{data.handle_status | handle_status }}</td>
                    <td class="text-align-center">{{data.memo}}</td>
                </tr>
            </tbody>
            <tfoot></tfoot>
        </table>
    </div>
    <!-- end widget content -->
    <div class="dt-toolbar-footer">
        <tm-pagination conf="paginationConf"></tm-pagination>
    </div>
    
    <div class="modal fade" id="editAlert" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabel">处理批注</h4>
                </div>
                <div class="modal-body">

                    <form id="smart-form-register" class="smart-form" data-smart-registration-form ng-submit="updatedata()">
                        <fieldset class="row">
                          
                            <section class="col-sm-5" style="margin: 0 20px 15px;">
                                <label class="label">处理描述</label>
                                <label class="input">
                                    <textarea rows="10" cols ="50" ng-model="editdata.memo" class="handle-alert"></textarea>

                                </label>
                            </section>
                          

                        </fieldset>

                        <footer>

                            <button type="button" class="btn btn-default" data-dismiss="modal">
                                关闭
                            </button>
                            <button type="submit" class="btn btn-primary">
                                提交
                            </button>

                        </footer>
                    </form>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->


</div>

<script>

    // START AND FINISH DATE
    $('#startdate').datepicker({
        //dateFormat : 'dd.mm.yy',
        dateFormat: 'yy-mm-dd',
        prevText: '<i class="fa fa-chevron-left"></i>',
        nextText: '<i class="fa fa-chevron-right"></i>',
        monthNames: ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],  
        dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],  
        dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],  
        dayNamesMin: ['日','一','二','三','四','五','六'],
        onSelect: function (selectedDate) {
            $('#finishdate').datepicker('option', 'minDate', selectedDate);
        }
    });

    $('#finishdate').datepicker({
        dateFormat: 'yy-mm-dd',
        prevText: '<i class="fa fa-chevron-left"></i>',
        nextText: '<i class="fa fa-chevron-right"></i>',
        monthNames: ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],  
        dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],  
        dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],  
        dayNamesMin: ['日','一','二','三','四','五','六'],
        onSelect: function (selectedDate) {
            $('#startdate').datepicker('option', 'maxDate', selectedDate);
        }
    });

</script>
<!-- END MAIN CONTENT -->



